using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Core_UIData_CompositeType_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Core.UIData.CompositeType);

            field = type.GetField("None", flag);
            app.RegisterCLRFieldGetter(field, get_None_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_None_0, null);
            field = type.GetField("Slider", flag);
            app.RegisterCLRFieldGetter(field, get_Slider_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Slider_1, null);
            field = type.GetField("ScrollX", flag);
            app.RegisterCLRFieldGetter(field, get_ScrollX_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_ScrollX_2, null);
            field = type.GetField("ScrollY", flag);
            app.RegisterCLRFieldGetter(field, get_ScrollY_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_ScrollY_3, null);
            field = type.GetField("GridScroll", flag);
            app.RegisterCLRFieldGetter(field, get_GridScroll_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_GridScroll_4, null);
            field = type.GetField("Paint", flag);
            app.RegisterCLRFieldGetter(field, get_Paint_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_Paint_5, null);
            field = type.GetField("Rocker", flag);
            app.RegisterCLRFieldGetter(field, get_Rocker_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_Rocker_6, null);
            field = type.GetField("UIContainer", flag);
            app.RegisterCLRFieldGetter(field, get_UIContainer_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_UIContainer_7, null);
            field = type.GetField("TreeView", flag);
            app.RegisterCLRFieldGetter(field, get_TreeView_8);
            app.RegisterCLRFieldBinding(field, CopyToStack_TreeView_8, null);
            field = type.GetField("UIDate", flag);
            app.RegisterCLRFieldGetter(field, get_UIDate_9);
            app.RegisterCLRFieldBinding(field, CopyToStack_UIDate_9, null);
            field = type.GetField("UIPalette", flag);
            app.RegisterCLRFieldGetter(field, get_UIPalette_10);
            app.RegisterCLRFieldBinding(field, CopyToStack_UIPalette_10, null);
            field = type.GetField("ScrollYExtand", flag);
            app.RegisterCLRFieldGetter(field, get_ScrollYExtand_11);
            app.RegisterCLRFieldBinding(field, CopyToStack_ScrollYExtand_11, null);
            field = type.GetField("DropDown", flag);
            app.RegisterCLRFieldGetter(field, get_DropDown_12);
            app.RegisterCLRFieldBinding(field, CopyToStack_DropDown_12, null);
            field = type.GetField("StackPanel", flag);
            app.RegisterCLRFieldGetter(field, get_StackPanel_13);
            app.RegisterCLRFieldBinding(field, CopyToStack_StackPanel_13, null);
            field = type.GetField("TabControl", flag);
            app.RegisterCLRFieldGetter(field, get_TabControl_14);
            app.RegisterCLRFieldBinding(field, CopyToStack_TabControl_14, null);
            field = type.GetField("DockPanel", flag);
            app.RegisterCLRFieldGetter(field, get_DockPanel_15);
            app.RegisterCLRFieldBinding(field, CopyToStack_DockPanel_15, null);
            field = type.GetField("DesignedDockPanel", flag);
            app.RegisterCLRFieldGetter(field, get_DesignedDockPanel_16);
            app.RegisterCLRFieldBinding(field, CopyToStack_DesignedDockPanel_16, null);
            field = type.GetField("DragContent", flag);
            app.RegisterCLRFieldGetter(field, get_DragContent_17);
            app.RegisterCLRFieldBinding(field, CopyToStack_DragContent_17, null);
            field = type.GetField("DataGrid", flag);
            app.RegisterCLRFieldGetter(field, get_DataGrid_18);
            app.RegisterCLRFieldBinding(field, CopyToStack_DataGrid_18, null);
            field = type.GetField("InputBox", flag);
            app.RegisterCLRFieldGetter(field, get_InputBox_19);
            app.RegisterCLRFieldBinding(field, CopyToStack_InputBox_19, null);
            field = type.GetField("PopMenu", flag);
            app.RegisterCLRFieldGetter(field, get_PopMenu_20);
            app.RegisterCLRFieldBinding(field, CopyToStack_PopMenu_20, null);
            field = type.GetField("AppendText", flag);
            app.RegisterCLRFieldGetter(field, get_AppendText_21);
            app.RegisterCLRFieldBinding(field, CopyToStack_AppendText_21, null);
            field = type.GetField("GridLayout", flag);
            app.RegisterCLRFieldGetter(field, get_GridLayout_22);
            app.RegisterCLRFieldBinding(field, CopyToStack_GridLayout_22, null);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Core.UIData.CompositeType());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Core.UIData.CompositeType[s]);


        }

        static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref huqiang.Core.UIData.CompositeType instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch(ptr_of_this_method->ObjectType)
            {
                case ObjectTypes.Object:
                    {
                        __mStack[ptr_of_this_method->Value] = instance_of_this_method;
                    }
                    break;
                case ObjectTypes.FieldReference:
                    {
                        var ___obj = __mStack[ptr_of_this_method->Value];
                        if(___obj is ILTypeInstance)
                        {
                            ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            var t = __domain.GetType(___obj.GetType()) as CLRType;
                            t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                        }
                    }
                    break;
                case ObjectTypes.StaticFieldReference:
                    {
                        var t = __domain.GetType(ptr_of_this_method->Value);
                        if(t is ILType)
                        {
                            ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                        }
                    }
                    break;
                 case ObjectTypes.ArrayReference:
                    {
                        var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as huqiang.Core.UIData.CompositeType[];
                        instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
                    }
                    break;
            }
        }


        static object get_None_0(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.None;
        }

        static StackObject* CopyToStack_None_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.None;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Slider_1(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.Slider;
        }

        static StackObject* CopyToStack_Slider_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.Slider;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_ScrollX_2(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.ScrollX;
        }

        static StackObject* CopyToStack_ScrollX_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.ScrollX;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_ScrollY_3(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.ScrollY;
        }

        static StackObject* CopyToStack_ScrollY_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.ScrollY;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_GridScroll_4(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.GridScroll;
        }

        static StackObject* CopyToStack_GridScroll_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.GridScroll;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Paint_5(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.Paint;
        }

        static StackObject* CopyToStack_Paint_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.Paint;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Rocker_6(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.Rocker;
        }

        static StackObject* CopyToStack_Rocker_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.Rocker;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_UIContainer_7(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.UIContainer;
        }

        static StackObject* CopyToStack_UIContainer_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.UIContainer;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_TreeView_8(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.TreeView;
        }

        static StackObject* CopyToStack_TreeView_8(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.TreeView;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_UIDate_9(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.UIDate;
        }

        static StackObject* CopyToStack_UIDate_9(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.UIDate;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_UIPalette_10(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.UIPalette;
        }

        static StackObject* CopyToStack_UIPalette_10(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.UIPalette;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_ScrollYExtand_11(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.ScrollYExtand;
        }

        static StackObject* CopyToStack_ScrollYExtand_11(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.ScrollYExtand;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_DropDown_12(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.DropDown;
        }

        static StackObject* CopyToStack_DropDown_12(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.DropDown;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_StackPanel_13(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.StackPanel;
        }

        static StackObject* CopyToStack_StackPanel_13(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.StackPanel;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_TabControl_14(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.TabControl;
        }

        static StackObject* CopyToStack_TabControl_14(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.TabControl;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_DockPanel_15(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.DockPanel;
        }

        static StackObject* CopyToStack_DockPanel_15(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.DockPanel;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_DesignedDockPanel_16(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.DesignedDockPanel;
        }

        static StackObject* CopyToStack_DesignedDockPanel_16(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.DesignedDockPanel;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_DragContent_17(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.DragContent;
        }

        static StackObject* CopyToStack_DragContent_17(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.DragContent;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_DataGrid_18(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.DataGrid;
        }

        static StackObject* CopyToStack_DataGrid_18(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.DataGrid;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_InputBox_19(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.InputBox;
        }

        static StackObject* CopyToStack_InputBox_19(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.InputBox;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_PopMenu_20(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.PopMenu;
        }

        static StackObject* CopyToStack_PopMenu_20(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.PopMenu;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AppendText_21(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.AppendText;
        }

        static StackObject* CopyToStack_AppendText_21(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.AppendText;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_GridLayout_22(ref object o)
        {
            return huqiang.Core.UIData.CompositeType.GridLayout;
        }

        static StackObject* CopyToStack_GridLayout_22(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.CompositeType.GridLayout;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


        static object PerformMemberwiseClone(ref object o)
        {
            var ins = new huqiang.Core.UIData.CompositeType();
            ins = (huqiang.Core.UIData.CompositeType)o;
            return ins;
        }


    }
}
